<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8"/>
	<title>智能化城市旅行后台管理系统</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minum-scale=1.0, maxum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" th:href="@{/layuiadmin/layui/css/layui.css}" media="all">
	<link rel="stylesheet" th:href="@{/layuiadmin/style/admin.css}" media="all">
	<script>
        /^http(s*):\/\//.test(location.href) || alert('请先部署到 localhost 下再访问');
	</script>
</head>

<body class="layui-layout-body">

<div id="LAY_app">
	<div class="layui-layout layui-layout-admin">
		<div class="layui-header">
			<!-- 头部区域 -->
			<ul class="layui-nav layui-layout-left">
				<li class="layui-nav-item layadmin-flexible" lay-unselect>
					<a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
						<i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
					</a>
				</li>
				<li class="layui-nav-item layui-hide-xs" lay-unselect>
					<a href="http://localhost:8080/dist/view" target="_blank" title="前台">
						<i class="layui-icon layui-icon-website"></i>
					</a>
				</li>
				<li class="layui-nav-item" lay-unselect>
					<a href="javascript:;" layadmin-event="refresh" title="刷新">
						<i class="layui-icon layui-icon-refresh-3"></i>
					</a>
				</li>
			</ul>
			<ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">

				<li class="layui-nav-item layui-hide-xs" lay-unselect>
					<a href="javascript:;" layadmin-event="theme">
						<i class="layui-icon layui-icon-theme"></i>
					</a>
				</li>
				<li class="layui-nav-item layui-hide-xs" lay-unselect>
					<a href="javascript:;" layadmin-event="note">
						<i class="layui-icon layui-icon-note"></i>
					</a>
				</li>
				<li class="layui-nav-item" lay-unselect>
					<a href="javascript:;">
						<cite>管理</cite>
					</a>
					<dl class="layui-nav-child">
						<dd>
							<!--<a th:href="@{/admin/passwd}">修改密码</a>-->
							<div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;">
								<a data-method="offset" data-type="auto" id="passwd" href="#">修改密码</a>
							</div>
						</dd>
						<hr>
						<dd layadmin-event="logout" style="text-align: center;">
							<a th:href="@{/admin/logout}">退出</a>
						</dd>
					</dl>
				</li>

				<li class="layui-nav-item layui-hide-xs" lay-unselect>
					<a href="javascript:;" layadmin-event="about"><i class="layui-icon layui-icon-more-vertical"></i></a>
				</li>
				<li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-unselect>
					<a href="javascript:;" layadmin-event="more"><i class="layui-icon layui-icon-more-vertical"></i></a>
				</li>
			</ul>
		</div>

		<!-- 侧边菜单 -->
		<div class="layui-side layui-side-menu">
			<div class="layui-side-scroll">
				<div class="layui-logo" lay-href="/admin/echars">
					<span>智能化城市旅行后台管理</span>
				</div>

				<ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
					<li data-name="home" class="layui-nav-item">
						<a href="javascript:;" lay-tips="主页" lay-direction="2">
							<i class="layui-icon layui-icon-home"></i>
							<cite>主页</cite>
						</a>
						<dl class="layui-nav-child">
							<dd data-name="console" class="layui-this">
								<a lay-href="/admin/echars">控制台</a>
							</dd>
						</dl>
					</li>
					<li data-name="component" class="layui-nav-item">
						<a href="javascript:;" lay-tips="用户" lay-direction="2">
							<i class="layui-icon layui-icon-user"></i>
							<cite>用户管理</cite>
						</a>
						<dl class="layui-nav-child">
							<dd data-name="teline">
								<a lay-href="/admin/userList">用户列表</a>
							</dd>
						</dl>
					</li>
					<li data-name="template" class="layui-nav-item">
						<a href="javascript:;" lay-tips="景点" lay-direction="2">
							<i class="layui-icon layui-icon-tree"></i>
							<cite>景点管理</cite>
						</a>
<!--						<dl class="layui-nav-child">-->
<!--							<dd>-->
<!--								<a href="javascript:;">景点设置</a>-->
								<dl class="layui-nav-child">
									<dd>
										<a lay-href="/scenic/scenicList">景点列表</a>
									</dd>
									<dd>
										<a lay-href="/scenic/scenicAdd">添加景点</a>
									</dd>
								</dl>
<!--							</dd>-->
							<!-- 
							<dd>
								<a lay-href="http://weather.com">天气预报</a>
							</dd> -->
<!--						</dl>-->
					</li>

					<li data-name="app" class="layui-nav-item">
						<a href="javascript:;" lay-tips="相册" lay-direction="2">
							<i class="layui-icon layui-icon-camera"></i>
							<cite>相册管理</cite>
						</a>
						<dl class="layui-nav-child">
							<dd>
								<a lay-href="/gallery/galleryList">相册图片</a>
							</dd>
							<dd>
								<a lay-href="/gallery/galleryAdd">添加照片</a>
							</dd>
						</dl>
					</li>
					<li data-name="app" class="layui-nav-item">
						<a href="javascript:;" lay-tips="消息" lay-direction="2">
							<i class="layui-icon layui-icon-speaker"></i>
							<cite>消息管理</cite>
						</a>
						<dl class="layui-nav-child">
							<dd>
								<a lay-href="/carousel/carouselList">轮播信息</a>
							</dd>
						</dl>
					</li>
					<li data-name="senior" class="layui-nav-item">
						<a href="javascript:;" lay-tips="酒店" lay-direction="2">
							<i class="layui-icon layui-icon-diamond"></i>
							<cite>酒店管理</cite>
						</a>
						<dl class="layui-nav-child">
							<dd data-name="teline">
								<a lay-href="/hotel/hotelList">酒店列表</a>
							</dd>
							<dd>
								<a lay-href="/hotel/hotelAdd">酒店添加</a>
							</dd>
						</dl>
					</li>
					<li data-name="user" class="layui-nav-item">
						<a href="javascript:;" lay-tips="订单" lay-direction="2">
							<i class="layui-icon layui-icon-spread-left"></i>
							<cite>订单管理</cite>
						</a>
						<dl class="layui-nav-child">
							<dd data-name="teline">
								<a lay-href="/orders/ordersList">景点订单</a>
							</dd>
<!--							<dd>-->
<!--								<a lay-href="/orders/hotel_orderList">酒店订单</a>-->
<!--							</dd>-->
						</dl>
						</dl>
					</li>
				</ul>
			</div>
		</div>
		<!-- 页面标签 -->
		<div class="layadmin-pagetabs" id="LAY_app_tabs">
			<div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
			<div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
			<div class="layui-icon layadmin-tabs-control layui-icon-down">
				<ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
					<li class="layui-nav-item" lay-unselect>
						<a href="javascript:;"></a>
						<dl class="layui-nav-child layui-an-fadein">
							<dd layadmin-event="closeThisTabs">
								<a href="javascript:;">关闭当前标签页</a>
							</dd>
							<dd layadmin-event="closeOtherTabs">
								<a href="javascript:;">关闭其它标签页</a>
							</dd>
							<dd layadmin-event="closeAllTabs">
								<a href="javascript:;">关闭全部标签页</a>
							</dd>
						</dl>
					</li>
				</ul>
			</div>
			<div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
				<ul class="layui-tab-title" id="LAY_app_tabsheader">
					<li lay-id="/admin/echars" class="layui-this"><i class="layui-icon layui-icon-home"></i></li>
				</ul>
			</div>
		</div>

		<!-- 主体内容 -->
		<div class="layui-body" id="LAY_app_body">
			<div class="layadmin-tabsbody-item layui-show">
				<iframe src="/admin/echars" frameborder="0" class="layadmin-iframe"></iframe>
			</div>
		</div>

		<!-- 辅助元素，一般用于移动设备下遮罩 -->
		<div class="layadmin-body-shade" layadmin-event="shade"></div>
	</div>
</div>

<script src="../layuiadmin/layui/layui.js"></script>
<script src="../../static/js2/jquery.min.js"></script>
<script>
    layui.config({
        base: '../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use('index');



    layui.use('layer', function(){ //独立版的layer无需执行这一句
        var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句

        //触发事件
        var active = {
            offset: function(othis){
                layer.open({
                    id:1,
                    type: 1,
                    title:'修改密码',
                    skin:'layui-layer-rim',
                    area:['450px', 'auto'],

                    content: ' <div class="row" style="width: 420px;  margin-left:7px; margin-top:10px;">'
                    +'<div class="col-sm-12" style="margin-top: 10px">'
                    +'<div class="input-group">'
                    +'<span class="input-group-addon"> 原密码:</span>'
                    +'<input id="oldpwd" type="password" class="form-control layui-input" placeholder="原密码">'
                    +'</div>'
                    +'</div>'
                    +'<div class="col-sm-12">'
                    +'<div class="input-group">'
                    +'<span class="input-group-addon"> 新 密 码   :</span>'
                    +'<input id="firstpwd" type="password" class="form-control layui-input" placeholder="请输入密码">'
                    +'</div>'
                    +'</div>'
                    +'<div class="col-sm-12" style="margin-top: 10px">'
                    +'<div class="input-group">'
                    +'<span class="input-group-addon">确认密码:</span>'
                    +'<input id="secondpwd" type="password" class="form-control layui-input" placeholder="请再输入一次密码">'
                    +'</div>'
                    +'</div>'
                    +'</div>'
                    ,
                    btn:['保存','取消'],
                    btn1:function (index,layero) {
						var firstpwd=$("#firstpwd").val()
						var secondpwd=$("#secondpwd").val()
						var oldpwd=$("#oldpwd").val()
						if (firstpwd!=secondpwd){
						    alert("两次密码不一致！")
						}else {
						    $.ajax({
                                url:"/admin/passwd?passwd="+firstpwd+"&oldpad="+oldpwd,
                                type:'post',
								success:function (data) {
                                    if (data.code==0){
                                        alert("修改成功！")
									}else if (data.code==201) {
                                        alert("原密码输入错误！")
									}else {
                                        alert("修改失败")
									}

                                },error:function () {
                                    alert("异常！")
                                }
							})
						    
                            layer.close(index);
						}
                    },
                    btn2:function (index,layero) {
                        layer.close(index);
                    }

                });
            }
        };

        $('#layerDemo #passwd').on('click', function(){
            var othis = $(this), method = othis.data('method');
            active[method] ? active[method].call(this, othis) : '';
        });

    });
</script>
</body>

</html>